<?php
/**
 * This file is part of webman.
 *
 * Licensed under The MIT License
 * For full copyright and license information, please see the MIT-LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @author    walkor<walkor@workerman.net>
 * @copyright walkor<walkor@workerman.net>
 * @link      http://www.workerman.net/
 * @license   http://www.opensource.org/licenses/mit-license.php MIT License
 */

use Webman\Route;

Route::group('/frontapi', function () {
    Route::get('', [app\controller\IndexController::class, 'index']);

    Route::get('/column/all', [\app\frontend\ColumnController::class, 'all']);

    Route::get('/web/index', [\app\frontend\IndexController::class, 'index']);
    Route::resource('/web/user', app\controller\WebUserController::class);
    Route::resource('/actor', app\controller\ActorController::class);


    Route::group('/basic', function () {
        Route::get('/banner/list', [\app\frontend\BannerController::class, 'index']);
        Route::resource('/genre', app\controller\GenreController::class);
        Route::resource('/country', app\controller\CountryController::class);
        Route::get('/country/all', [app\controller\CountryController::class, 'getAll']);
        Route::get('/link/all', [\app\frontend\ColumnController::class, 'linkall']);
        Route::get('/language/all', [app\controller\LanguageController::class, 'getAll']);
        Route::get('/genre/all', [app\controller\GenreController::class, 'getAll']);
        Route::resource('/language', app\controller\LanguageController::class);
    });

    Route::group('/common', function () {
        Route::any('/upload', [app\controller\CommonController::class, 'upload']);
    });


    Route::resource('/movie', app\controller\MovieController::class);
    Route::resource('/movievideo', app\controller\MovieVideoController::class);
    Route::resource('/video', app\controller\VideoController::class);

    Route::any('/captchaImage', [app\controller\CommonController::class, 'captcha']);


    Route::any('/getRouters', [app\controller\CommonController::class, 'getRouters']);
    Route::any('/getInfo', [app\controller\CommonController::class, 'getInfo']);
    Route::any('/login', [app\controller\UserController::class, 'login']);
//    Route::group('/actor', function () {
//        Route::any('/create', function ($request) {return response('create');});
//        Route::any('/list', [app\controller\ActorController::class, 'list']);
//        Route::any('/view/{id}', function ($request, $id) {return response("view $id");});
//    });

    Route::any('/system/dict/data/type/{type}', [app\controller\SystemController::class, 'column_type']);


});



Route::group('/api', function () {
    Route::get('', [app\controller\IndexController::class, 'index']);
    Route::resource('/column', app\controller\ColumnController::class);
    Route::get('/column/all', [app\controller\ColumnController::class, 'all']);
    Route::resource('/system/dict/type', app\controller\DictTypeController::class);
    Route::resource('/web/user', app\controller\WebUserController::class);
    Route::resource('/actor', app\controller\ActorController::class);


    Route::group('/basic', function () {
        Route::resource('/genre', app\controller\GenreController::class);
        Route::resource('/country', app\controller\CountryController::class);
        Route::get('/country/all', [app\controller\CountryController::class, 'getAll']);
        Route::get('/language/all', [app\controller\LanguageController::class, 'getAll']);
        Route::get('/genre/all', [app\controller\GenreController::class, 'getAll']);
        Route::resource('/language', app\controller\LanguageController::class);
    });

    Route::group('/common', function () {
        Route::any('/upload', [app\controller\CommonController::class, 'upload']);
    });


    Route::resource('/movie', app\controller\MovieController::class);
    Route::resource('/movievideo', app\controller\MovieVideoController::class);
    Route::resource('/video', app\controller\VideoController::class);

    Route::any('/captchaImage', [app\controller\CommonController::class, 'captcha']);


    Route::any('/getRouters', [app\controller\CommonController::class, 'getRouters']);
    Route::any('/getInfo', [app\controller\CommonController::class, 'getInfo']);
    Route::any('/login', [app\controller\UserController::class, 'login']);
//    Route::group('/actor', function () {
//        Route::any('/create', function ($request) {return response('create');});
//        Route::any('/list', [app\controller\ActorController::class, 'list']);
//        Route::any('/view/{id}', function ($request, $id) {return response("view $id");});
//    });

    Route::any('/system/dict/data/type/{type}', [app\controller\SystemController::class, 'column_type']);
//    Route::group('/video', function () {
//        Route::any('/create', function ($request) {return response('create');});
//        Route::get('/list', [app\controller\VideoController::class, 'list']);
//        Route::delete('/{id}', [app\controller\VideoController::class, 'delete']);
//        Route::put('/', [app\controller\VideoController::class, 'save']);
//    });

});


